<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"   %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>学生页面添加信息 </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
    <style>
     #contain{
     margin-left:120px;
      margin-right:172px;
      background-color: #ccffcc;
     }
	
	  #top{
        height:180px;
	    width:1000px;
	    border-bottom: 0px solid;
	
	    background-color: #ccffcc;
	
	   
	 
	  }
	  #center{
      height:400px;
	  width:1000px;
      border-top: 5px solid;
       border-color: #ffffcc;
      background-color: #ccffcc;
	  }
	  #bottom{
      height:100px;
	   width:1000px;
	  border-top: 5px solid;
	   border-color: #ffffcc;
	  background-color: #ccffcc;
	  }
	

	.user{
	   margin-bottom:100px;
	   margin-left: 600px;
	}
	
	#main{
	
	  height:60px;
	  margin-top:20px;
	 
	}
	#reg{
	
	font-size: 150%;
	font-weight: bold;
	}
	</style>
	<script type="text/javascript">
	function checkForm(){
 
	var name = document.getElementById("name").value;
	
	if(name.length<=0){
	alert("姓名不能为空");
    return false;
	}
	
	var birth = document.getElementById("birth").value;
	if(birth==null&&birth==""){
	alert("出生日期不能为空");
	  return false;
	}
		
	var number = document.getElementById("number").value;
	if(number==null&&birth==""){
	alert("学号不能为空");
	  return false;
	
	}
	if(number.length!=12){
	  alert("对不起，你输入的学号不合法");
	    return false;
	  
	}
    var esdate = document.getElementById("esdate").value;
    if(esdate==null&&esdate==""){
      alert("对不起，入学日期不能为空");
     
     return false;
	}

	
   
	var saddress = document.getElementById("saddress").value;
	if(saddress==null&&saddress==""){
	  alert("对不起，籍贯不能为空");
	   return false;
	}
	
	}
	
	</script>
 </head>

 <body>
    <div id="contain">
      <div id="top">
    <img src="${pageContext.request.contextPath}/Picture/ee.jpg"></img>
      <span class="user">用户名|欢迎用户使用|退出</span>
   	
    </div>
      <div id="center">
     <div id="main">
     <span id="reg">学生信息注册</span>
     </div>
     <div id="formid">
        <form action="student_addS.action" method="post">
        <table height="300px" width="800px" border="0" align="center">
           <tr >
               <td>姓名</td>
               <td><input type="text" id="name" name="name"/></td>
           </tr>
             <tr>
               <td>性别</td>
               <td>  <s:radio list="#{'男':'男生','女':'女生' }"
                name="sex" value="女" ></s:radio>
               </td>
           </tr>
             <tr>
               <td>出生日期</td>
               <td><input type="text" id="birth" name="birth"/></td>
               <td>按格式yyyy-mm-dd</td>
           </tr>
           <tr>
               <td>学号</td>
               <td><input type="text" id="number" name="number"/></td>
                  <td>长度必须为12位</td>
           </tr>
              <tr>
               <td>班级</td>
               <td><input type="text" id="sclass" name="sclass"/></td>
               <td>按格式计13-3</td>
           </tr>
               <tr>
               <td>籍贯</td>
               <td><input type="text"  id="saddress" name="saddress"/></td>
             </tr>
            <tr>
               <td>入学日期</td>
               <td><input type="text" id="esdate"  name="esdate"/></td>
                <td>按格式yyyy-mm-dd</td>
             </tr>
             <tr>
               <td>系</td>
               <td>
                  <select name="sdpet">
                     <option>计算机科学技术</option>
                    <option>网络工程</option>
                    <option>软件工程</option>
                  </select>
               </td>
             </tr>
             <tr>
                <td rowspan="2">
                   <input type="submit" value="确定"  onclick="return checkForm()"/> 
                <!-- <img src="${pageContext.request.contextPath}/Picture/anniu.png" width="60px" height="30px"></img>-->
                </td>
             </tr>
        </table>
        </form>
     
     </div>
     </div>
     <div  id="bottom">
           <p align="center">   版权&copy;:版权所有，违者必究
         </p>
          <address align="center">E-mail:abcdef@126.com</address>
     
     </div>
</div>


 </body>
</html>

